package org.chen.wordwave.Api;

import org.chen.wordwave.bean.ApiResponse;
import org.chen.wordwave.bean.Feedback;
import org.chen.wordwave.bean.FindPws;
import org.chen.wordwave.bean.Lesson;
import org.chen.wordwave.bean.ResultBody;
import org.chen.wordwave.bean.SignIn;
import org.chen.wordwave.bean.UpdateUserInfo;
import org.chen.wordwave.bean.UserGoogleLoginRequest;
import org.chen.wordwave.bean.UserInfo;
import org.chen.wordwave.bean.UserLoginRequest;
import org.chen.wordwave.bean.UserRegisterRequest;
import org.chen.wordwave.bean.VersionCheckRequest;
import org.chen.wordwave.bean.VersionCheckResponse;
import org.chen.wordwave.bean.WordsDTO;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiService {
    @POST("/user/login")
    Call<ResultBody> login(@Body UserLoginRequest request);

    @POST("/user/register")
    Call<UserRegisterRequest> register(@Body UserRegisterRequest userRegisterRequest);

    @POST("/feedback")
    Call<Feedback> feedback(@Body Feedback feedback);

    @POST("/user/signIn")
    Call<SignIn> SignIn(@Body SignIn SignIn);

    @POST("/user/getUserInfo")
    Call<UserInfo> getUserInfo(@Body UserRegisterRequest userRegisterRequest);

    @POST("/user/registerUserInfo")
    Call<String> registerUserInfo(@Body UserRegisterRequest userRegisterRequest);

    @POST("/user/registerUserInfoByEmail")
    Call<String> registerUserInfoByEmail(@Body UserRegisterRequest userRegisterRequest);

    @POST("/user/updateUserProfile")
    Call<String> updateUserProfile(@Body UpdateUserInfo userInfo);

    @POST("/user/updateUserPws")
    Call<String> updateUserPws(@Body UpdateUserInfo userInfo);

    @POST("/forGetUserPws")
    @Headers("Content-Type:application/json;charset=utf-8")
    Call<String> forGetUserPws(@Body FindPws findPws);

    @POST("/user/clearUser")
    Call<ResultBody> clearUser(@Body UserRegisterRequest userRegisterRequest);

    @GET("/user/get")
    Call<ResultBody> get();
    @POST("/user/gift")
    Call<SignIn> gift(@Body SignIn signIn);

    @POST("/sendDeleteRequest")
    Call<ResultBody> sendDeleteRequest(@Body UserRegisterRequest userRegisterRequest);

    @POST("/user/googleLogin")
    Call<ResultBody> googleLogin(@Body UserGoogleLoginRequest request);

    @GET("/lesson/list")
    Call<ApiResponse<Map<String, Object>>> getLessonList(
            @Query("current") int current,
            @Query("size") int size,
            @Query("category") String category
    );

    @GET("/lesson/{id}")
    Call<ApiResponse<Lesson>> getLessonDetail(@Path("id") Long id);

    @GET("/words/init/all")
    Call<ApiResponse<List<WordsDTO>>> getInitWords();

    // 版本检查接口
    @POST("/version/check")
    Call<ApiResponse<VersionCheckResponse>> checkVersion(@Body VersionCheckRequest request);
}
